Apache Wicket Interview Questions and Answers
Question: How to get ServletContext in apache-wicket application?Answer:Yes, you can get the ServletContext class via Wicket’s WebApplication class like this : import javax.servlet.ServletContext; import org.apache.wicket.Page; import org.apache.wicket.protocol.http.WebApplication; import com.withoutbook.hello.Hello; public class CustomApplication extends WebApplication { @Override public Class<? extends Page> getHomePage() { ServletContext servletContext = WebApplication.get().getServletContext(); return Hello.class; //return default page } } |
Is it helpful?
Yes
No
Most helpful rated by users:
- What is Wicket Framework?
- What are Wicket Models?
- What is Base class for HTML pages?
- What are the Ways to create a page in wicket?
- How to integrate apache-wicket with Spring?